<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>

</head>
<style>
    * {
        margin: 0;
        padding: 0;
        list-style: none;

    }

    body {
        background-color: bisque;
    }

    .wrap {
        width: 1200px;
        height: 1500px;
        margin: 0 auto;
        text-align: center;
    }

    .input {
        width: 300px;
        margin: 0 auto;
        text-align: left;
    }

    input {
        margin: 50px auto;
        height: 50px;
        width: 300px;
        outline: none;
        font-size: 40px;
        background-color: beige;
        border: 1px solid rgb(212, 172, 113);
        border-radius: 5px;
    }

    button {
        margin: 0 auto;
        width: 300px;
        height: 50px;
        background-color: beige;
        border: 1px solid rgb(212, 172, 113);
        font-size: 25px;
        border-radius: 5px;
        font-family: "黑体";
        font-weight: 900;
    }
</style>

<body>
    <div class="wrap">
        <h1>——————————</h1>
        <h1>丨学生管理系统注册界面丨</h1>
        <h1>——————————</h1>
        <br>
        <div class="input">
            <form action="" method="">
                <label for="user_name">
                    <h2></h2>
                    <h2>用户名:</h2>
                    <h2></h2>
                    <input type="text" name="user_name" id="user_name">
                </label>
                <label for="password">
                    <h2></h2>
                    <h2>密码:</h2>
                    <h2></h2>
                    <input type="password" name="password" id="password">
                </label>
                <br>
                <br>

                <button type="submit">注册</button>
            </form>
        </div>
    </div>


</body>
<script src="./jquery/jquery-3.2.1.min.js"></script>
<script>
    $("button").click((e) => {
        e.preventDefault();
        $.ajax({
            method: "post",
            url: "http://localhost:3000/register",
            data: {
                user_name: $("#user_name").val(),
                password: $("#password").val()
            },
            success: (data) => {
                console.log(data)
            },
            error: (err) => {
                console.log("网络超时，请检查您的网络设置")
            }
        })
    })
</script>

</html>